<?php
function smarty_function_news ($params, $template)
{

	isset($params['page'])?$page=(int)$params['page']:$page=1;
	isset($params['step'])?$step=(int)$params['step']:$step=10;
	isset($params['show'])?$show=(int)$params['show']:$show=10;
	isset($params['channels'])?$channels=$params['channels']:$channels='';
	isset($params['fields'])?$fields=$params['fields']:$fields='date, title, short';
	isset($params['order'])?$order=$params['order']:$order='date DESC';
	isset($params['where'])?$where=$params['where']:$where='';
	isset($params['channels_only'])?$channels_only=$params['channels_only']:$channels_only=false;
	isset($params['check_next'])?$check_next=$params['check_next']:$check_next=false;

	require_once BASEPATH.'core/Model'.EXT;
	require_once BASEPATH.'core/CodeIgniter'.EXT;
	include_once APPPATH."/modules/module.news.php";

	$NEWS = new News();

	$data = $NEWS->view($page, $step, $show, $channels, $fields, $order, $where, $channels_only, $check_next);

	$template->assign('NEWS', $data);

	return "";

}